<!-- addEdit#(model).html #(now())-->
#include("define/input.html")
#if(autocodeModel.list_type=="ztree")
<div class="ibox">
	<div class="ibox-title">
		<h5>#(autocodeModel.name)编辑</h5>
		<div class="pull-right">
			#[[#if(]]##(object).id)&nbsp;<a href="javascript:" style="font-size:12px;color:#666" onclick="add(#[[#(]]##(object).id))">新增子#(autocodeModel.name)</a>&nbsp;&nbsp;
			<a href="javascript:" style="font-size:12px;color:#666" onclick="add(#[[#(]]##(object).parent_id))">新增同级#(autocodeModel.name)</a>&nbsp;&nbsp;#[[#end]]#
   		<a href="javascript:" style="font-size:12px;color:#666" onclick="closeEdit()">关闭</a>
    </div>
	</div>
	<div class="ibox-content">
		<form id="form" class="form-horizontal required-validate" method="post" action="save#(model)" novalidate="novalidate" onsubmit="return validateCallback(this,thisAjaxDone)">
			<input type="hidden" name="#(object).id" value="#[[#(]]##(object).id)"/>
			<input type="hidden" name="#(object).parent_id" value="#[[#(]]##(object).parent_id)"/>
			#if(parent)<input type="hidden" name="#(object).#(firstLowerCase(parent.code))_id" value="#[[#(]]##(object).#(firstLowerCase(parent.code))_id)"/>#end
			<div class="form-group">
		   	<label class="col-xs-2 control-label">上级#(autocodeModel.name)：</label>
		     <div class="col-xs-9" style="line-height: 35px">
		     #[[#if(]]#parent#(model))#[[#(]]#parent#(model).name)#[[#else无#end]]#
		     </div>
		  </div>
			#for(item:columnList)#if(item.inputType)
			<div class="form-group">
				<label class="col-xs-2 control-label">#(item.name)：</label>
				<div class="col-xs-9">
					#@showInput(item,object)
				</div>
			</div>#end#end
		  <div class="form-group">
		   	<div class="col-xs-9 col-xs-offset-2">
		     	<button type="submit" class="btn btn-primary">保存</button>
		     	#[[#if(]]##(object).id)
		     		&nbsp;&nbsp;<a class="btn btn-danger" href="delete#(autocodeModel.code)?id=#[[#(]]##(object).id)" target="ajaxTodo" title="确定删除吗？" callback="deleteAjaxTodo">删除</a>
		     	#[[#end]]#
		    </div>
		  </div>
		</form>
 	</div>
</div>
#else
#[[#@HplusLayout()]]#
#[[#define cssStyle()]]#
#if(autocodeModel.select2)
<link href="#[[#(res_path)]]#/hplus/css/plugins/select2/select2.min.css" rel="stylesheet">
#end
#[[#end]]#
#[[#define content()]]#
<div style="padding:10px;height: 100%">
	<form method="post" class="form-horizontal required-validate" action="save#(model)" novalidate="novalidate" onsubmit="return validateCallback(this,listDialogAjaxDone)">
		<input type="hidden" name="#(object).id" value="#[[#(]]##(object).id)"/>
		#if(parent)<input type="hidden" name="#(object).#(firstLowerCase(parent.code))_id" value="#[[#(]]##(object).#(firstLowerCase(parent.code))_id)"/>#end
		#for(item:columnList)#if(item.inputType)
		<div class="form-group">
			#if(autocodeModel.full)
				<label class="col-xs-2 control-label">#(item.name)：</label>
				<div class="col-xs-9">
					#@showInput(item,object)
				</div>
			#else
				<label class="col-xs-3 control-label">#(item.name)：</label>
				<div class="col-xs-8">
					#@showInput(item,object)
				</div>
			#end
		</div>#end
		#end
		<div class="form-group">
			<div class="col-xs-8 #if(autocodeModel.full) col-xs-offset-2#else col-xs-offset-3#end">
				<button type="submit" class="btn btn-primary">保存</button>
			</div>
		</div>
	</form>
</div>
#[[#end]]#
#[[#define js()]]#
<script src="#[[#(res_path)]]#/hplus/js/plugins/validate/jquery.validate.min.js"></script>
<script src="#[[#(res_path)]]#/hplus/js/plugins/validate/messages_zh.min.js"></script>
#if(autocodeModel.datetime)
<script src="#[[#(res_path)]]#/hplus/js/plugins/laydate/laydate.js"></script>
#end
#if(autocodeModel.xheditor)
<script src="#[[#(res_path)]]#/hplus/js/plugins/xheditor/xheditor-1.2.2.min.js"></script>
<script src="#[[#(res_path)]]#/hplus/js/plugins/xheditor/zh-cn.js"></script>
#end
#if(autocodeModel.select2)
<script src="#[[#(res_path)]]#/hplus/js/plugins/select2/select2.full.min.js"></script>
#end
#[[#end]]#
#[[#define jsFunction()]]#
<script>
$(function(){
#if(autocodeModel.select2user)
	$("select[name='#(object).#(autocodeModel.select2user)']").select2({
		placeholder:"请输入用户名或姓名搜索",
		ajax: {url: "#[[#(res_path)]]#/portal/auth/select2LoadUserList",dataType: 'json',delay: 250,
		  data: function (params) {
		  	return {keyword: params.term,portal: "PORTAL"};
			},
			processResults: function (data) {return {results: data}},
			cache: true
		}
	});
#end
#if(autocodeModel.datetime)
	laydate.render({elem:"input[name='#(object).#(autocodeModel.datetime)']",type:"datetime"});
#end
});
</script>
#[[#end]]#
#end